﻿@page
@{ Layout = "_Layout"; }

<el-card>
    <el-form v-on:submit.native.prevent :inline="true" :model="formInline" :size="euiSize">
        <el-form-item label="时间：从">
            <el-date-picker v-model="formInline.dateFrom"
                            type="date"
                            value-format="yyyy-MM-ddTHH:mm:ss.000Z"
                            placeholder="选择开始日期">
            </el-date-picker>
        </el-form-item>
        <el-form-item label="到">
            <el-date-picker v-model="formInline.dateTo"
                            type="date"
                            value-format="yyyy-MM-ddTHH:mm:ss.000Z"
                            placeholder="选择结束日期">
            </el-date-picker>
        </el-form-item>
        <el-form-item label="关键字">
            <el-input v-model="formInline.keyword" placeholder="关键字"></el-input>
        </el-form-item>

        <el-form-item>
            <el-button :size="euiSize" type="primary" v-on:click="btnSearchClick" icon="el-icon-search">查 询</el-button>
            <el-button type="primary" plain :size="euiSize" v-on:click="btnExportClick" icon="el-icon-download">导出日志</el-button>
            <el-button type="danger" plain :size="euiSize" v-on:click="btnDeleteClick" icon="el-icon-delete">清空日志</el-button>
        </el-form-item>
    </el-form>
    <el-table :data="items" :size="euiSize"
              style="width: 100%" :height="($(window).height() - 155)">
        <el-table-column label="#"
                         type="index"
                         width="60"
                         align="left">
            <template scope="scope">
                <span>{{(formInline.currentPage - 1) * formInline.limit + scope.$index + 1}}</span>
            </template>
        </el-table-column>
        <el-table-column prop="createdDate" align="left"
                         width="150"
                         label="日期">
        </el-table-column>
        <el-table-column width="350" align="left"
                         label="Id">
            <template slot-scope="scope">
                <el-link :underline="false" type="primary" v-on:click="btnLogView(scope.row.id)">{{scope.row.guid}}</el-link>
            </template>
        </el-table-column>
        <el-table-column label="错误消息" show-overflow-tooltip align="right">
            <template slot-scope="scope">
                <span v-html="scope.row.message"></span>
            </template>
        </el-table-column>
        @await Html.PartialAsync("_PartialTableEmpty")
    </el-table>

    <el-row style="margin-top: 10px">
        <el-col :span="24" align="center">
            <el-pagination v-on:current-change="handleCurrentChange" background
                           :current-page="formInline.currentPage"
                           :page-size="formInline.limit"
                           layout="total, prev, pager, next, jumper"
                           :total="count">
            </el-pagination>
        </el-col>
    </el-row>

</el-card>
@section Scripts{
    <script src="/sitefiles/assets/js/admin/settings/logsError.js" type="text/javascript"></script>
}